package cn.supermaster.management.web.controller.task;

import cn.supermaster.management.common.controller.BaseController;
import cn.supermaster.management.web.service.task.ISTaskLogService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

/**
 * All rights Reserved, Designed By www.super-bytecode.com
 *
 * @ProjectName: supermaster-management
 * @Package: cn.supermaster.management.web.controller.task
 * @ClassName: ScheduleTaskLogController
 * @Description: [调度日志操作处理]
 * <p> </p>
 * @Author: [Lance Ting]
 * @Date: 2021/2/19 17:35
 * @Version: V1.0
 * @Copyright: 2021 www.super-bytecode.com Inc. All rights reserved.
 * TODO: 注意,本文件Lance Ting所作,如果转载或使用请标明具体出处!
 **/

@Controller
@RequestMapping("/monitor/jobLog")
public class ScheduleTaskLogController extends BaseController {

    @Autowired
    private ISTaskLogService taskLogService;

    @RequiresPermissions("monitor:job:view")
    @GetMapping()
    public String skipScheduleTaskLogView(@RequestParam(value = "jobId", required = false) Long jobId, ModelMap modelMap) {
        return taskLogService.skipScheduleTaskLogView(modelMap, jobId);
    }

    @RequiresPermissions("monitor:job:detail")
    @GetMapping("/detail/{jobLogId}")
    public String skipScheduleTaskLogDetail(@PathVariable("jobLogId") Long jobLogId, ModelMap modelMap) {
        return taskLogService.skipScheduleTaskLogDetail(modelMap, jobLogId);
    }

}
